package com.qf.spring.test;

import com.qf.spring.service.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author 郑大仙丶
 * @version 1.0
 * @date 2021/3/18 17:30
 * 测试Spring创建对象，并管理依赖关系，解决IOC介绍时，阐述的问题
 */
public class Demo2 {

    @Test
    public void test(){
        ApplicationContext ac = new ClassPathXmlApplicationContext("classpath:applicationContext.xml");

        UserService userService = (UserService) ac.getBean("userServiceImpl");

        userService.save();
    }


}
